home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
271_02
/
untab.doc
< prev
next >
Wrap
Text File
|
1988-01-27
|
2KB
|
46 lines
NAME
untab -- expand horizontal tabs to spaces
SYNOPSIS
r = untab(dest, source, tabsize, length);
int r; result of operation
char *dest; pointer to destination string
char *source; pointer to source string
int tabsize; tab increment size
int length; length of destination area
DESCRIPTION
This function can be used to replace tab characters (09H)
in a string with spaces. This is useful for printing
to printers which do not recognize tab characters, or
for altering the tab spacing in use. The range of tabsize
is 1 to 16. Any other value will simply return the
string with all tabs intact. Be sure the destination
string has been declared with enough room to hold the
fully expanded source string. Normally, a tabsize of 8
is used, since that is the "standard" tab increment used on
most printers and terminals. This function returns FALSE
if the expansion will not fit into the destination.
EXAMPLE
char destination[200];
char source[80];
int r;
strcpy(source, "This string has a\ttab character in\ttwo places");
r = untab(destination, source, 8, 200);
if(!r) error("String expanded will be too large for destination");
(The destination has spaces in place of the tab characters.)
This function is found in SMTCx.LIB for the Turbo-C Compiler
This function introduced in Version 1.31 of SMTCx.LIB for
Turbo-C Version 1.5 only.